from selenium.webdriver.common.by import By

class OrderManagementLocator:

    # 初始页面展开的tab
    default_page_expanded = (By.CSS_SELECTOR, '[aria-expanded="true"]')

    #order_management_tab
    order_management_tab = (By.XPATH, "//div[contains(@data-menu-id,'ORDER_MANAGEMENT_PLT')]")

    #user_my_resource_tab
    user_my_resource_tab=(By.CSS_SELECTOR,'[path="/work_bench/myResource"]')


    #user_order_management_tab
    user_order_management_tab=(By.XPATH, "//div[contains(@data-menu-id, 'ORDER_CST')]")

    #credit_control tab
    credit_control_tab = (By.XPATH, "//div[contains(@data-menu-id,'CREDIT_CONTROL')]")

    #dunning_methods_tab
    dunning_methods_tab=(By.CSS_SELECTOR,'[path="/console/dunningMethods"]')

    #expense_control
    expense_control_tab=(By.CSS_SELECTOR,'[path="/console/expenseControl"]')


    #order_tab
    order_tab=(By.CSS_SELECTOR,'[path="/console/orderManagement/order"]')

    # 翻页
    page_total = (By.CSS_SELECTOR, '[class="antd4-pagination-total-text"]')

    #defaluat_acct_type
    defaluat_acct_type=(By.XPATH,'//form[@class="antd4-form antd4-form-inline"]/div[1]//span[@class="antd4-select-selection-item"]')

    #acct_type_select
    acct_type_select=(By.CSS_SELECTOR,'[class="antd4-select antd4-select-single antd4-select-show-arrow"]')

    #bp_chooice
    bp_chooice=(By.CSS_SELECTOR,'[title="Business Partner"]')

    #order_id
    order_id=(By.CSS_SELECTOR,'[class="cre-table-nowrap"]>a')

    #company_name
    company_name_input=(By.CSS_SELECTOR,'[id="companyName"]')

    #company_choice
    company_choice=(By.CSS_SELECTOR,'class="antd4-select-item-option-content"')

    #bp_data
    bp_data=(By.CSS_SELECTOR,'[class="antd4-table-row antd4-table-row-level-0"]')

    #refresh_button
    refresh_button=(By.CSS_SELECTOR,'[class="antd4-btn antd4-btn-default antd4-btn-icon-only"]')

    #order_id_list
    order_id_list=(By.CSS_SELECTOR,'[class="antd4-table-row antd4-table-row-level-0"]>:nth-child(2)>div>a')

    #detail_order_id
    detail_order_id=(By.CSS_SELECTOR,'[class="antd4-space antd4-space-horizontal antd4-space-align-center"]>:nth-child(1)>div')

    #down_load_button
    down_load_button=(By.CSS_SELECTOR,'[aria-label="download"]')

    #start_time
    start_time=(By.CSS_SELECTOR,'[placeholder="Start Date"]')

    #end_time
    end_time=(By.CSS_SELECTOR,'[placeholder="End Date"]')

    #view_detail_button
    view_detail_button=(By.XPATH,"//td[contains(@class,'fix-right-first')]/a")

    #download_button
    download_button=(By.CSS_SELECTOR,'[class="antd4-btn antd4-btn-primary"]')

    #grace_period
    grace_period=(By.CSS_SELECTOR,'[id="list_0_firstLevelInterval"]')

    # ZAR
    zar = (By.XPATH, '//*[@id="list_0_MZN"]/..')

    # down
    down=(By.XPATH,'(//*[@aria-label="down"])[5]')

    # zar_text
    zar_text = (By.XPATH,'(//*[text()="ZAR"])[1]')

    # please enter
    please_enter = (By.XPATH,'//div[text()="Please enter"]')

    # 成功提示
    success_prompt = (By.XPATH, "//span[contains(@class,'anticon-check-circle')]")

    #postpaid_customer_tab
    postpaid_customer_tab=(By.CSS_SELECTOR,'[class="antd4-tabs-nav-list"]>:nth-child(2)>div')

    #postpaid_grace_period
    postpaid_grace_period=(By.CSS_SELECTOR,'[id="list_1_firstLevelInterval"]')

    #fixed_value_input
    #fixed_value_input=(By.CSS_SELECTOR,'[class="antd4-input-number-input-wrap"]>input')
    fixed_value_input=(By.XPATH,'//*[@aria-hidden="false"]//input[@id="list_0_ZAR"]')

    #user_resource_create_button
    user_resource_create_button=(By.CSS_SELECTOR,'[class="antd4-form antd4-form-inline"]>div>:nth-child(1)>div>button')


    #product_button
    product_button=(By.XPATH,"//div[contains(@class,'productBtn')]")




